#ifndef __LINEAR_GRADIENT_BRUSH_H__
#define __LINEAR_GRADIENT_BRUSH_H__

#ifdef __apple__
#include "gofgame/common/graphics/Brush.h"
#include "LinearGradientDirection.h"
#include "cxx_0x.h"
#else
#include "gofgame/common/graphics/Brush.h"
#include "gofgame/common/graphics/LinearGradientDirection.h"
#include "gofgame/common/cxx_0x.h"
#endif //__apple__

using namespace gofgame::common::graphics;

namespace gofgame {
	namespace common {
		namespace graphics {
			class LinearGradientBrush : public Brush {
			public:
				LinearGradientBrush(
					const ccColor4F &startColor, 
					const ccColor4F &endColor,
					LinearGradientDirection linearGradientDirection = LinearGradientDirection_Vertical);
				LinearGradientBrush(
					float beginR, float beginG, float beginB, float beginA,
					float endR, float endG, float endB, float endA,
					LinearGradientDirection linearGradientDirection = LinearGradientDirection_Vertical);

				LinearGradientBrush *getInversedBrush() const;

				virtual bool isTransparent() const _override;
				virtual LinearGradientDirection getLinearGradientDirection() const;
				virtual const ccColor4F &getStartColor() const;
				virtual const ccColor4F &getEndColor() const;

			protected:
				virtual void onFillRect(float left, float top, float width, float height) _override;

			private:
				ccColor4F startColor;
				ccColor4F endColor;
				LinearGradientDirection linearGradientDirection;
			};
		}
	}
}

#endif //__LINEAR_GRADIENT_BRUSH_H__
